Behaviors let nonprogrammers make their HTML pages interactive. They offer web designers an easy way to assign an actions to page elements by filling in an HTML form.
You should write behavior actions when you want to share functions with nonprogrammers, or when you want to insert the same JavaScript function repeatedly but change the parameters each time.
Note: You cannot use behaviors to insert VBScript functions directly; however, you can add a VBScript function indirectly by editing the DOM in the applyBehavior()
function.
The term "behavior" refers to the combination of an event (such as onClick
, onLoad
, or onSubmit
) and an action (for example, Check Plugin, Go to URL, Swap Image). The browser determines which HTML elements accept which events. Files listing events that each browser supports are stored in the Configuration/Behaviors/Events folder within the Dreamweaver application folder.
Actions are HTML files. The BODY
of an action file generally contains an HTML form that accepts parameters for the action (for example, parameters indicating which layers are to be shown or hidden). The HEAD
of an action file contains JavaScript functions that process form input from the BODY
and control the functions, arguments, and event handlers that are inserted into a user's document.